<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arrays=[1,2,6,4,5,6];
        console.log(arrays.indexOf(6));//2,从左往右查找
        console.log(arrays.lastIndexOf(6));//5 从右往左查找

        //includes,查找是否包含该元素
        // console.log("唐玮sn".includes("s"));//true
        console.log(arrays.includes(5));//true

   console.log("_______________");


        //find,找到这个值就返回这个值，没有的话返回undefined
        let arrays1=[12,31,25,45];
       let result= arrays1.find(function(item){  //这里面必须是个方法

        //    return item==4;//undefined
        return item==45;
        });
      console.log(result);

      
    </script>   
</body>
</html>